<extend name="Common@Layout:hui-admin" />
<block name="title"><title>角色管理</title></block>
<block name="style">
</block>

<block name="main">
	<nav class="breadcrumb">
		<i class="Hui-iconfont"></i>
		 首页 <span class="c-gray en">&gt;</span>
		 角色管理 <span class="c-gray en">&gt;</span>  
		权限管理 
		<a class="btn btn-success radius r mr-20" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont"></i></a>
	</nav>
	
	<div class="pd-20">
		<div class="cl pd-5 bg-1 bk-gray"> 
			<div class="btn-group l mr-20">
				<select class="input-text" style="width:auto;" id="changeG">
					<php>$groups = C('AUTH_MINI_ROLE_GROUP');</php>
					<foreach name="groups" item="vo">
						<option value="{$key}" <eq name="auth_role_group" value="$key">selected</eq>>{$key}</eq>
					</foreach>
				</select>
			</div>
			<span class="l"> 
				<a href="javascript:;" class="btn btn-danger radius ajax-post confirm" target-form="mini-form" data-msg="确定批量删除？" data-url="/admin/authgroup/del.html"><i class="Hui-iconfont"></i> 批量删除</a> 
				<a class="btn btn-primary radius" href="javascript:;" onclick="open_iframe_dialog('{:U('authgroupadmin/edit')}','创建角色',['750px','490px'],1)"><i class="Hui-iconfont"></i> 添加角色</a> 
			</span> 
		</div>
		<php>
			$map['group'] = $auth_role_group;
			$result = _get_list_data('/users/authgroupadmin/index/',$_GET,$map,D('AuthGroup'));
		</php>
		<form class="mini-form">
		<table class="table table-border table-bordered table-hover table-bg">
			<thead>
				<tr>
					<th scope="col" colspan="6">角色管理</th>
				</tr>
				<tr class="text-c">
					<th width="25"><input type="checkbox" value="" name=""></th>
					<th width="40">ID</th>
					<th width="200">角色名</th>
					<th width="300">描述</th>
					<th width="70">状态</th>
					<th width="70">操作</th>
				</tr>
			</thead>
			<tbody>
				<foreach name="result['data']['list']" item="vo">
				<tr class="text-c">
					<td><if condition="$vo['id'] gt 1"><input type="checkbox" value="{$vo.id}" name="ids[]"></if></td>
					<td>{$vo.id}</td>
					<td>{$vo.title}</td>
					<td>{$vo.desc|default="未设置"}</td>
					<td>
            			<if condition="$vo.status eq 1"><span class="c-green">启用</span><else/><span class="c-red">禁用</span></if>
					</td>
					<td class="f-14">
            			<if condition="$vo['id'] gt 1"><a style="text-decoration:none" class="ml-5" onclick="open_iframe_dialog('{:U('authgroupadmin/edit','id='.$vo['id'])}','修改角色',['750px','490px'],1)" href="javascript:;" title="编辑"><i class="Hui-iconfont"></i></a>
            			<a style="text-decoration:none" class="ml-5 mini_del" data-url="{:U('authgroupadmin/del','ids='.$vo['id'])}" href="javascript:;" title="删除"><i class="Hui-iconfont"></i></a></if>
      				</td>
				</tr>
				</foreach>
			</tbody>
		</table>
		</form>
		{$result['pagetpl']}
	</div>
</block>

<block name="script">
<script>
$('#changeG').change(function(){
	var g = $(this).val();
	window.location.href="/users/authgroupadmin/index/group/"+g+".html"; 
});
</script>
</block>